package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Systemdictionary;
import cn.wolfcode.mapper.SystemdictionaryMapper;
import cn.wolfcode.quest.QueryObject;
import cn.wolfcode.service.ISystemDictionaryService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//字典目录
@Service
public class SystemDictionaryServiceImpl  implements ISystemDictionaryService {
    @Autowired
    private SystemdictionaryMapper mapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Systemdictionary record) {
        return mapper.insert(record);
    }

    @Override
    public Systemdictionary selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Systemdictionary> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(Systemdictionary record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo selectList(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());

        List<Systemdictionary> list=mapper.selectList(qo);

        return new PageInfo(list);
    }
}
